{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### K-means Clustering\n",
    "\n",
    "Clustering is the most commonly used unsupervised learning method. This is because typically it is one of the best ways to explore and find out more about data visually. There are several different types of clustering, including:\n",
    "\n",
    "- Hierarchical clustering: builds a multilevel hierarchy of clusters by creating a cluster tree.\n",
    "- k-Means clustering: partitions data into k distinct clusters based on distance to the centroid of a cluster.\n",
    "- Gaussian mixture models: models clusters as a mixture of multivariate normal density components.\n",
    "- Self-organizing maps: uses neural networks that learn the topology and distribution of the data.\n",
    "- Hidden Markov models: uses observed data to recover the sequence of states.\n",
    "\n",
    "In K-means clustering, for each point $x$:\n",
    "* Find the nearest centroid $c$\n",
    "* assign the point $x$ to cluster $j$\n",
    "and then for each cluster $j$ $(=1,\\dots,K)$:\n",
    "* The new centroid $c$ is equal to the mean of all points $x$ assigned to the cluster $j$ in the previous step."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Are There Any Limitations Of K-Means Algorithm?\n",
    "\n",
    "There are however limitations of K-Means algorithm:\n",
    "    \n",
    "* K-Means algorithm does not work well with missing data.\n",
    "* It uses a random seed to generate clusters which makes the results un-deterministic and random. We can however supply our own random seed number.\n",
    "* It can get slower with larger data items.\n",
    "* It does not work well with categorical (textual) data.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
